package src.main.java.org.File;
/*
* 方法递归案例：求阶乘
* */
public class Test4 {
    public static void main(String[] args) {
        int jiecheng = jiecheng(5);
        System.out.println(jiecheng);
    }
    public static int jiecheng(int n){
        //终结点
        if(n==1){
            return 1;
        }else{
            return jiecheng(n-1) * n;
        }
    }
}
